var e = require("../../@babel/runtime/helpers/interopRequireDefault"), r = e(require("../../@babel/runtime/regenerator")), t = require("../../@babel/runtime/helpers/asyncToGenerator"), o = e(require("../../http/robot")), a = require("../../utils/tool"), n = new o.default(), i = getApp();

Page({
    data: {
        orderNo: ""
    },
    onLoad: function(e) {
        i.data.sourceInfo = "优选机", this.setData({
            orderNo: (0, a.getUrlOptions)(e.q).orderNo
        }), this.getDetail();
    },
    getDetail: function() {
        var e = this;
        return t(r.default.mark(function t() {
            var o, a;
            return r.default.wrap(function(r) {
                for (;;) switch (r.prev = r.next) {
                  case 0:
                    return r.prev = 0, wx.showLoading({
                        title: "加载中"
                    }), r.next = 4, n.robotOrderBaseInfo(e.data.orderNo);

                  case 4:
                    if (o = r.sent, a = o.data.orderStatus, i.isLogin() || o.data.memberId || 0 == a) {
                        r.next = 9;
                        break;
                    }
                    return wx.reLaunch({
                        url: "/pages/robot_login/robot_login?orderNo=".concat(e.data.orderNo)
                    }), r.abrupt("return");

                  case 9:
                    0 == a || 20 == a ? wx.redirectTo({
                        url: "/pages/robot_status/robot_status?orderStatus=".concat(a)
                    }) : 10 == a ? wx.redirectTo({
                        url: "/pages/robot_order/robot_order?orderNo=".concat(e.data.orderNo)
                    }) : 50 == a || 70 == a ? wx.redirectTo({
                        url: "/pages/robot_detail/robot_detail?orderNo=".concat(e.data.orderNo)
                    }) : wx.reLaunch({
                        url: "/pages/index/index"
                    }), r.next = 14;
                    break;

                  case 12:
                    r.prev = 12, r.t0 = r.catch(0);

                  case 14:
                    return r.prev = 14, wx.hideLoading(), r.finish(14);

                  case 17:
                  case "end":
                    return r.stop();
                }
            }, t, null, [ [ 0, 12, 14, 17 ] ]);
        }))();
    }
});